
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Measure.h>
#include <LengthUnit.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(Measure)
{


    TEST(should be able to display 63431 INCH as 1 MILE 1 YARD 2 FEET 11 INCH)
    {
        Measure<LengthUnit> length(63431, INCH);
        ASSERT_EQ((" 1 MILE 1 YARD 2 FEET 11 INCH"), length.print(MILE));
    }

    TEST(should be able to display 1 MILE as 63360 INCH)
    {
        Measure<LengthUnit> length(1, MILE);
        ASSERT_EQ((" 63360 INCH"), length.print(INCH));
    }

    TEST(should be able to display 35 INCH as 2 FEET 11 INCH)
    {
        Measure<LengthUnit> length(35, INCH);
        ASSERT_EQ((" 2 FEET 11 INCH"), length.print(MILE));
    }

    TEST(should be able to display 38 INCH as 1 YARD 2 INCH)
    {
        Measure<LengthUnit> length(38, INCH);
        ASSERT_EQ((" 1 YARD 2 INCH"), length.print(MILE));
    }

    TEST(should be able to display 48 INCH as 1 YARD 1 FEET)
    {
        Measure<LengthUnit> length(48, INCH);
        ASSERT_EQ((" 1 YARD 1 FEET"), length.print(MILE));
    }

    TEST(should be able to display 5 FEET as 1 YARD 2 FEET)
    {
        Measure<LengthUnit> length(5, FEET);
        ASSERT_EQ((" 1 YARD 2 FEET"), length.print(MILE));
    }

    TEST(should be able to display 1781 YARD as 1 MILE 21 YARD)
    {
        Measure<LengthUnit> length(1781, YARD);
        ASSERT_EQ((" 1 MILE 21 YARD"), length.print(MILE));
    }

    TEST(should be able to compare 2 mile = 1760 yard + 1 mile)
    {
        Measure<LengthUnit> length1(1, MILE);
        Measure<LengthUnit> length2(1760, YARD);
        Measure<LengthUnit> length3(2, MILE);
        ASSERT_TRUE(length3 == (length2 + length1));
    }


    TEST(should be able to compare 3520 yard + 1 mile = 10560 feet + 63360 inch)
    {
        Measure<LengthUnit> length1(1, MILE);
        Measure<LengthUnit> length2(3520, YARD);
        Measure<LengthUnit> length3(10560, FEET);
        Measure<LengthUnit> length4(63360,INCH);
        ASSERT_TRUE((length3 + length4) == (length2 + length1));
    }
};

